package net.designbased.jspfire;

import com.thoughtworks.xstream.annotations.*;

/**
 * 图表标题
 * @author chenhongliang
 */
@XStreamAlias("vc:Title")
public class Title {

    @XStreamAlias("Text")
    @XStreamAsAttribute
    private String text;

    @XStreamAlias("Enabled")
    @XStreamAsAttribute
    private boolean enabled;

    /**
     * 获取标题文本
     * @return
     */
    public String getText(){
        return this.text;
    }

    /**
     * 设置标题文本
     * @param text 文本
     */
    public void setText(String text){
        this.text = text;
    }

    /**
     * 是否启用标题
     * @return
     */
    public boolean isEnabled(){
        return this.enabled;
    }

    /**
     * 设置是否启用标题
     * @param enabled true / false
     */
    public void setEnabled(Boolean enabled){
        this.enabled = enabled;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Title other = (Title) obj;
        if ((this.text == null) ? (other.text != null) : !this.text.equals(other.text)) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 31 * hash + (this.text != null ? this.text.hashCode() : 0);
        return hash;
    }
}
